﻿using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace RuoVea.WebTest.Controllers
{
    //[ApiController]
    //[ApiExplorerSettings(GroupName = "文件管理_Files")]
    //public class FilesController
    //{
    //    private FileApp _app;

    //    public FilesController(FileApp app)
    //    {
    //        _app = app;
    //    }
        
        ///// <summary>
        //    /// 加载附件列表
        //    /// </summary>
        //[HttpGet]
        //public async Task<TableData> Load([FromQuery] QueryFileListReq request)
        //{
        //    return await _app.Load(request);
        //}

        ///// <summary>
        ///// 删除附件
        ///// </summary>
        ///// <param name="ids"></param>
        ///// <returns></returns>
        //[HttpPost]
        //public Response Delete([FromBody] string[] ids)
        //{
        //    var result = new Response();
        //    try
        //    {
        //        _app.Delete(ids);

        //    }
        //    catch (Exception ex)
        //    {
        //        result.Code = 500;
        //        result.Message = ex.InnerException?.Message ?? ex.Message;
        //    }

        //    return result;
        //}

        /// <summary>
        ///  批量上传文件接口
        /// <para>客户端文本框需设置name='files'</para>
        /// </summary>
        /// <param name="files"></param>
        /// <returns>服务器存储的文件信息</returns>
        //[HttpPost]
        //public dynamic Upload(IFormFileCollection files)
        //{
        //    try
        //    {
        //        return  _app.Add(files);
        //    }
        //    catch (Exception ex)
        //    {
        //        return ex.Message;
        //    }

        //}
    //}
}
